package com.ai.springai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.ai.ollama.api.OllamaApi;
import org.springframework.ai.ollama.api.OllamaOptions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: suren@517na.com
 * @CreateTime: 2025-06-01
 * @Description: Spring AI 配置类
 */

@Configuration
public class SpringAIConfig {
    @Bean
    public ChatClient ollamaChatClient() {
        return ChatClient.builder(OllamaChatModel.builder()
                        .ollamaApi(OllamaApi.builder().build())
                .defaultOptions(
                        OllamaOptions.builder()
                        .model("deepseek-r1:1.5b").build()
                ).build())
                .build();
    }
}
